package com.jdyinfo.ic.service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.jdyinfo.ic.mysql.entity.Building;
import com.jdyinfo.ic.mysql.mapper.BuildingMapper;

@Service("buildingService")
public class BuildingService {
	@Autowired
	BuildingMapper buildingMapper;
	
	public List<Building> findBuilding(int upTownPeriodId) {
		return buildingMapper.findBuildingByUpTownPeriodId(upTownPeriodId);
	}
	
	public int createBuilding(Building building) {
		return buildingMapper.insertOne(building);
	}
	
	public int updateBuilding(Building building) {
		return buildingMapper.updateOne(building);
	}
	
	public int deleteBuilding(int id) {
		return buildingMapper.deleteOne(id);
	}
	
}
